package com.neusoft.po;

import java.io.Serializable;

public class ResponseBean<T> implements Serializable {
//	泛型属性，代表任意类型的数据对象
	private T data;
//	数据状态码,给前端程序用的
	private Integer code;
//	数据状态信息，发到前端给人看的
	private String msg;
//	该构造器用来封装正常操作结果的数据
	public ResponseBean(T data) {
		this.code=200;
		this.msg="success";
		this.data=data;
	}
//该构造器用来封装异常操作的结果
//code此时代表异常状态码
//msg此时代表异常信息
//异常状态下数据保持null的状态	
public ResponseBean(Integer code, String msg) {
	super();
	this.code = code;
	this.msg = msg;
}
//其他用途的构造器
public ResponseBean(T data, Integer code, String msg) {
	super();
	this.data = data;
	this.code = code;
	this.msg = msg;
}
public T getData() {
	return data;
}
public void setData(T data) {
	this.data = data;
}
public Integer getCode() {
	return code;
}
public void setCode(Integer code) {
	this.code = code;
}
public String getMsg() {
	return msg;
}
public void setMsg(String msg) {
	this.msg = msg;
}


	
	
	
}
